rem
	bbdoc: Player!
end rem
Type TPlayer Extends TActor
	Function Create:TPlayer(code, x, y:Int)
		Local d:TPlayer = New TPlayer
		
		d.x = x
		d.y = y
		
		d.dmg = 5
		d.health = 10
		d.code = code
		actorList.AddLast(d)
		Return d
	End Function
	Method Move(x, y)
		If testMap.map[Self.x + x, Self.y + y].collides = True Then
			console.consoleAdd("Ouch! You bumped into a "+testMap.map[Self.x + x, Self.y + y].name)
			Return testMap.map[Self.x + x, Self.y + y].code
		EndIf
		Local Actor:TActor
		For Actor = EachIn actorList
			If Self.x + x = Actor.x And Self.y + y = Actor.y Then 
				Attack(Actor)
				Return 2
			EndIf
		Next		
		'Move yourself
		Self.x:+x
		Self.y:+y
		camera.Move(x,y)
		console.consoleAdd("You are now in the " + Self.x + " " + Self.y)
		Return 1
	End Method
	Method Update()
		Draw()
		If health<=0 
			Notify "You lost!"
			End
		End If
	End Method
	Method Attack(Handle:TActor)
		Handle.health:-Self.dmg
		consoleAdd("You attack "+Handle.code+" for "+Self.dmg+" damage")
		If Handle.health<=0 Then consoleAdd(Handle.code+" dies")
	End Method
End Type
